package com.tenement.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  实体类。
 *
 * @author BertXie
 * @since 1.0.1
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "sys_order")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    private Long id;

    /**
     * 产品id(表名-id)
     */
    private String productId;

    /**
     * 支付时间
     */
    private LocalDateTime paymentDate;

    /**
     * 下单时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 金额
     */
    private BigDecimal amount;

    /**
     * 支付方式
     */
    private String type;

    /**
     * 优惠码
     */
    private Long couponId;

    /**
     * 支付状态(0为待支付,1为支付,2为取消,3为超时系统取消)
     */
    private Boolean status;

}
